home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / editor / timelapse.rexx < prev    next >
OS/2 REXX Batch file  |  1995-12-22  |  4KB  |  136 lines

  1. /* TimeLapse.rexx V3.0 -- Record frames at intervals of 1 to 60 mins */
  2. /* By Bob Caron © 1995 NewTek Inc.     (...It starts!)               */
  3. /* Based on an original script by Arnie Cachelin © 1992 NewTek Inc.  */
  4.  
  5. OPTIONS RESULTS
  6.  
  7. call remlib('ToasterARexx.port')
  8. call remlib('PROJECT_REXX_PORT')
  9.  
  10. call addlib('PROJECT_REXX_PORT' , 0)
  11. call ADDLIB('ToasterARexx.port' , 0)
  12.  
  13. call set_view(2)
  14. call req_error("TimeLapse V3.0     ---     Record frames to a sequence of image files at intervals.")
  15.  
  16. rx startfilereq("Save Frames Where?","Toaster:Images","TimeLapse.Rgb")
  17.  
  18. exit=1
  19. do while exit=1
  20.   name=queryfilereq()
  21.   if name=0 then call quit
  22.   if name~="" then exit=0
  23.   address command "c:wait 1"
  24. end
  25.  
  26. call req_error("")
  27.  
  28. delay=0
  29. do while(delay<1)
  30.    delay=req_number("Delay In Seconds",'30')
  31.    if delay="CANCEL" then call quit()
  32.    end
  33.  
  34. tdelay=delay
  35.  
  36. if delay<30 then if req_tell("Warning!","There is a good chance I can't","save images fast enough for","the dely time you entered.")=0 then call quit
  37.  
  38. call req_error("Example: 150 frames = 5 seconds.")
  39.  
  40. count=0
  41. do while(count<1)
  42.    count=req_number("Number Of Frames To Grab",150)
  43.    if count="CANCEL" then call quit()
  44.    end
  45.  
  46. call req_error("")
  47.  
  48. vidinput="-1"
  49. buttons='1000'
  50. do while vidinput="-1"
  51.   buttons=req_buttons("Choose Input:",buttons,"Main 1","Main 2","Main 3","Main 4")
  52.   if buttons="CANCEL" then call quit
  53.   if buttons="1000" then do
  54.      vidinput="001"
  55.      end
  56.   if buttons="0100" then do
  57.      vidinput="002"
  58.      end
  59.   if buttons="0010" then do
  60.      vidinput="003"
  61.      end
  62.   if buttons="0001" then do
  63.      vidinput="004"
  64.      end
  65. end
  66.  
  67. format=-1
  68. buttons='10'
  69. do while format=-1
  70.   buttons=req_buttons("Choose File Format:",buttons,"24Bit IFF","Framestore")
  71.   if buttons="CANCEL" then call quit
  72.   if buttons="10" then do
  73.      format=0
  74.      end
  75.   if buttons="01" then do
  76.      format=1
  77.      end
  78. end
  79.  
  80. if req_tell("Click 'Continue' to begin.")=0 then call quit
  81.  
  82. inputp="P"||vidinput
  83. inputm="M"||vidinput
  84.  
  85. if delay="" then delay = 1
  86. if delay<1 then delay = 1
  87. if delay>60 then delay = 60
  88. if count="" then count=10
  89. if count>1000 then count=1000
  90. if name="" then name=left(date(),6)
  91. /*delay=delay*60*/ /* <- By request of P.L. I am ditching the minute   */
  92.                    /* restriction... SEE! We listen! Although I am not */
  93.                    /* sure it will work out well with save time being  */
  94.                    /* what it is! :)                                   */
  95.  
  96. Switcher(TOSW)        /* Go to Switcher screen */
  97. Switcher(inputp)
  98. Switcher(inputm)
  99. Switcher(LVID)        /* Set to live digital video */
  100. call req_open("Working.... Please wait.")
  101. f=1
  102. call req_error("TimeLapse:  Current Frame ("||right(f,3,'0')||")   Frames to go ("||count-f||")   Delay ("||delay||")")
  103. do f=1 to count
  104.   Switcher(FVID)      /* Freeze frame */
  105.   fname=strip(name)||"."||right(f,3,'0')
  106.   call req_close()
  107.   call req_open("Working.... Please wait.")
  108.   call req_error("TimeLapse:  Current Frame ("||right(f,3,'0')||")   Frames to go ("||count-f||")   Delay ("||delay||")")
  109.   SaveNextFrame(fname,format)
  110.   Switcher(LVID)      /* Set to live digital video */
  111.   address command "C:Wait "||delay
  112. end
  113. call req_close()
  114. call req_error("")
  115. call req_error("All done.")
  116. call remlib('ToasterARexx.port')
  117. call remlib('PROJECT_REXX_PORT')
  118.  
  119. exit
  120.  
  121. SaveNextFrame:  Procedure
  122.   arg name,format
  123.   if format=0 then
  124.      t=switcher(SRGB,name,4,0)
  125.   else
  126.      t=switcher(FMSV,name,4)
  127. return t
  128.  
  129. quit:
  130.    call req_error("Canceled.")
  131.    call remlib('ToasterARexx.port')
  132.    call remlib('PROJECT_REXX_PORT')
  133.    exit
  134.  
  135.  
  136.